-
Notifications
You must be signed in to change notification settings - Fork 4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Mark gcc as gcc
instead of compiler
in Unix CC toolchain
#16297
Conversation
gcc
as gcc
instead of compiler
in Unix CC toolchaingcc
instead of compiler
in Unix CC toolchain
363d121
to
a943d9e
Compare
This makes it possible to detect `gcc` specifically via a `config_setting` for the `@bazel_tools//tools/cpp:compiler` flag with value `gcc`. RELNOTES: The `@bazel_tools//tools/cpp:compiler` flag now has the value `gcc` if the configured compiler is detected to be gcc rather than the generic value `compiler`. A branch for `gcc` may have to be added to `select` statements that do not have a default case that handles gcc appropriately.
a943d9e
to
7dbc590
Compare
@oquenchil Would you be available to review this? |
} | ||
|
||
function test_compiler_flag_clang() { | ||
# TODO: The default toolchain always uses XCode's clang, but sets the compiler name to the generic |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you force using the C++ only toolchain on macOS this would likely pass, although maybe it still shouldn't
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I briefly went over the control flow and it seemed as if the fallback to the Unix toolchain would only be picked if Xcode couldn't be find. I have a follow-up PR where I will dig deeper into the macOS case.
This makes it possible to detect gcc specifically via a `config_setting` for the `@bazel_tools//tools/cpp:compiler` flag with value `gcc`. RELNOTES: The `@bazel_tools//tools/cpp:compiler` flag now has the value `gcc` if the configured compiler is detected to be gcc rather than the generic value `compiler`. A branch for `gcc` may have to be added to `select` statements that do not have a default case that handles gcc appropriately. Fixes bazelbuild#12707 Closes bazelbuild#16297. PiperOrigin-RevId: 475467838 Change-Id: I9fa98ddd3c7f29742357596280dfc98c939f0253
This makes it possible to detect gcc specifically via a
config_setting
for the@bazel_tools//tools/cpp:compiler
flag with valuegcc
.RELNOTES: The
@bazel_tools//tools/cpp:compiler
flag now has the valuegcc
if the configured compiler is detected to be gcc rather than the generic valuecompiler
. A branch forgcc
may have to be added toselect
statements that do not have a default case that handles gcc appropriately.Fixes #12707